﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace RAD.LightOne.Web.Security
{
#if DEBUG
    [Serializable]
    public class Logger
    {
        private string path;

        public Logger(string path)
        {
            this.path = path;
            if (!File.Exists(this.path))
            {
                File.CreateText(this.path);
            }
        }

        public void Log(string format, params object[] args)
        {
            StreamWriter writer = File.AppendText(this.path);
            writer.WriteLine(format, args);
            writer.Flush();
            writer.Close();
        }

        public void Log(string message)
        {
            StreamWriter writer = File.AppendText(this.path);
            writer.WriteLine(message);
            writer.Flush();
            writer.Close();
        }


    }

#endif
}
